import Base64 from "base-64";
import {generalQueryBySQLSerialNumber} from '@/api/generalBusiness.js'
/**
 * 通用方法
 */
const ShopCartQuantity = {
	onShow(){
		this.modifyShopNum(0);
		this.ShopCartQuantity();
	},
	methods:{
		//查询购物车数量
		async ShopCartQuantity(){
			const res = await generalQueryBySQLSerialNumber({
				SQLSerialNumber:'M_business_shopping_trolley_Quantity',
				Condition:Base64.encode(this.Open_ID),
				ExtensionCondition:''
			})
			if(res.length == 1){
				this.modifyShopNum(res[0].Quantity)
			}else{
				this.modifyShopNum(0)
			}
		},
	}
}

module.exports = {
	ShopCartQuantity
}